import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import axios from 'axios'

// 引入 Vant 组件和样式
import { Form, Field, Button, Toast, Tabbar, TabbarItem, CellGroup, Cell, Icon, Dialog } from 'vant'
import 'vant/es/toast/style'
import 'vant/es/form/style'
import 'vant/es/field/style'
import 'vant/es/button/style'
import 'vant/es/tabbar/style'
import 'vant/es/tabbar-item/style'
import 'vant/es/cell-group/style'
import 'vant/es/cell/style'
import 'vant/es/icon/style'
import 'vant/es/dialog/style'
import Vant from 'vant'
import 'vant/lib/index.css'

const app = createApp(App)

app.use(createPinia())
app.use(router)
app.use(ElementPlus)
app.use(Form)    // 注册 Form
app.use(Field)   // 注册 Field
app.use(Button)  // 注册 Button
app.use(Toast)   // 注册 Toast
app.use(Tabbar)
app.use(TabbarItem)
app.use(CellGroup)
app.use(Cell)
app.use(Icon)
app.use(Dialog)
app.use(Vant)

app.config.globalProperties.$axios = axios

app.mount('#app')
